<!--{include file='admin/public/header.html'}-->
<!--编辑器JS-->
<link rel="stylesheet" href="view/admin/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="view/admin/public/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="view/admin/public/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="view/admin/public/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="view/admin/public/kindeditor/plugins/code/prettify.js"></script>

<!--图片上传-->
<!--{include file='admin/public/swfupload.html'}-->

<!--编辑器給textarea赋值-->
<script type="text/javascript">
$(function(){
	$("#form1").validationEngine();
	picslist();
});

$('.setThumb').live('click',function(){
	var _path = $(this).attr('rel');
	var _key = $(this).attr('vkey');//图片id
	$('#setDivThumb').html('<input type="hidden" name="picindex" value="'+_key+'" />');
	
	$('.setThumb').removeClass('setThumbOK');
	$('.dlist img').removeClass('imgSelect').removeAttr('style');
	$(this).addClass('setThumbOK');
	$('#img_'+_key).addClass('imgSelect').css({
		'width' : $('#img_'+_key).width() - 4,
		'height' : $('#img_'+_key).height() - 4
	});
});

</script>

<script>
	var editor1,editor2;
    KindEditor.ready(function(K) {
        editor1 = K.create('textarea[name="description"]', {
            cssPath : 'view/admin/public/kindeditor/plugins/code/prettify.css',
            uploadJson : 'view/admin/public/kindeditor/php/upload_json.php',
            fileManagerJson : 'view/admin/public/kindeditor/php/file_manager_json.php',
            allowFileManager : true
        });

        //prettyPrint();
    });
</script>

        <div class="page-header">
          <h3 class="fl">增加产品</h3>
          <div class="user_message fr"><i class="icon-wrench"></i><a href="#">保存页面排序</a></div>
          <div class="cl"></div>
        </div>
        <form name="form1" id="form1" class="form-inline" action="" method="post" enctype="multipart/form-data">
       <table class="table set_table">
        	<thead>
            <tr>
              <th width="100" >功 能</th>
              <th >配 置</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td valign="middle">分类</td>
              <td>
              <select class="span3 parentCate validate[required]" name="cateid"  >
             <!--{foreach from=$cate key=k item=v}-->
                <optgroup label="<!--{$v.categoryname}-->"><!--{$v.categoryname}--></option>
                <!--{foreach from=$v.items key=ik item=iv}-->
                <option value="<!--{$iv.id}-->"  type="<!--{$iv.type}-->" ><!--{$iv.categoryname}--></option>
                <!--{/foreach}-->
             <!--{/foreach}-->
              </select>
              </td>
            </tr>
            <tr>
              <td valign="middle">产品名称</td>
              <td>
              <input name="name" id="name" type="text" class="span4 validate[required]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">购买地址</td>
              <td>
              <input name="mall" id="mall" type="text" class="span4 validate[custom[url]]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">产品价格</td>
              <td>
              <input name="price" id="price" type="text" class="span4 validate[min[0]]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">产品特价</td>
              <td>
              <input name="promotion" id="promotion" type="text" class="span2 validate[min[0]]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">产品图片</td>
				<td>
				<div style="position: relative">
					<span id="spanButtonPlaceholder"></span>
					<input type="button" class="submit" id="btnUpload" value="批量选择" /> &nbsp;&nbsp; 
					<input type="button" class="submit" id="btnCancel" value="  中止上传  " />
				</div>
				<div style="margin-top:10px;" id="divLoadingContent" class="content" style="display: none;">上传组件正在加载中...</div>
				<div style="margin-top:10px;" style="margin-top:10px;" id="divLongLoading" class="content" style="display: none;">上传组件加载超时!请确保浏览器支持FLASH 10!</div>
				<div style="margin-top:10px;" id="divAlternateContent" class="content" style="display: none;">上传组件加载失败!请确保浏览器支持FLASH 10!</div>  
				<div style="margin-top:10px;" class="fieldset flash" id="fsUploadProgress"></div>
				<p style="margin-top:10px;" id="divStatus">提示: 可以按 Ctrl 或 Shift 键多选.</p>
				</td>
            </tr>
            <tr class="pics_list" style="display: none;">
            	<td></td>
            	<td id="pics_upload_list"><img src="static/images/loading.gif" align="absmiddle"> 列表加载中...</td>
            </tr>
            <tr>
              <td valign="middle">品牌</td>
              <td>
              <input name="brand" id="brand" type="text" class="span2" />
              </td>
            </tr>
            <tr>
              <td valign="middle">颜色</td>
              <td>
              <input name="color" id="color" type="text" class="span2" />
              </td>
            </tr>
            <tr>
              <td valign="middle">型号</td>
              <td>
              <input name="model" id="model" type="text" class="span2" />
              </td>
            </tr>
            <tr>
              <td valign="middle">数量</td>
              <td>
              <input name="amount" id="amount" type="text" class="span2 validate[custom[integer],min[1]]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">产地</td>
              <td>
              <input name="origin" id="origin" type="text" class="span6" />
              </td>
            </tr>
            <tr>
              <td valign="middle">单位</td>
              <td>
              <input name="unit" id="unit" type="text" class="span2 " />
              </td>
            </tr>
            <tr>
              <td valign="middle">产品关键词</td>
              <td>
              <input name="keywords" id="keywords" type="text" class="span4 validate[required]" />
              </td>
            </tr>
            <tr>
              <td valign="middle">产品描述</td>
              <td>
              <textarea name="description" cols="" rows="5" class="span9 validate[required]"></textarea>
              </td>
            </tr>
          </tbody>
        </table>
		<p class="border_top">
		<span id="setDivThumb"></span>
		<button type="submit" class="btn btn-primary btn-small input-small">添加</button>
		</p>
        <div class="copyright"></div>

</form>

 <!--{include file='admin/public/footer.html'}-->
